package com.neusoft.elmboot.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.neusoft.elmboot.po.Food;

@Mapper
public interface FoodMapper {

	@Select("select * from food where businessId=#{businessId} order by foodId")
	public List<Food> listFoodByBusinessId(Integer businessId);
	
	@Select("select * from food where foodId=#{foodId}")
	public Food getFoodById(Integer foodId);

	/**
	 * 查询食品列表（带分页功能）
	 * @param params
	 * @return
	 */
	List<Food> listAllFood(Map<String,Object> params);

	/**
	 * 查询食品总数
	 * @param params
	 * @return
	 */
	Long listAllFoodCount(Map<String,Object> params);

	/**
	 * 新增食品
	 */
	Integer addFood(Food food);

	/**
	 * 更新食品（根据foodId全部更新）
	 * @param food
	 * @return
	 */
	Integer updateFoodById(Food food);

	/**
	 * 删除食品（根据foodId逻辑删除）
	 * @param foodId
	 * @return
	 */
	Integer delFood(Integer foodId);
}